Inverting partitioned matrices